#include "cursor.h"

//cursor server++++++++++++++++++++++++++++++++++
//constructor-----------
Cursor::cursorServer::cursorServer(){
}
Cursor::cursorServer::~cursorServer(){
}
//signal connection-----
void Cursor::cursorServer::requestCursorEnter(cursorListener* lst){
    lst->enterConnect = signalClick.connect(sigc::mem_fun(*lst, &cursorListener::signal_curs_enter));
}
void Cursor::cursorServer::requestCursorMove(cursorListener* lst){
    lst->moveConnect = signalMove.connect(sigc::mem_fun(lst, &cursorListener::signal_curs_move));
}
//signal emiters
void Cursor::cursorServer::moveCursor(int x, int y){
    cursor[0] = x;
    cursor[1] = y;
    signalMove.emit(cursor[0], cursor[1]);
}
void Cursor::cursorServer::selectCursor(){
    signalClick.emit(cursor[0], cursor[1]);
}
//access----------------
void Cursor::cursorServer::requestCursorCoords(int* x, int* y){
    *x = cursor[0];
    *y = cursor[1];
}
//===============================================